var list = [
  {
    id: "5024ff40-ae63-11ec-ba5b-3bb17d65f78f",
    updateTime: "2022-03-27",
    imageUrl:
      "https://img.villaday.com/images/merchant/10479/audit_house/4Df6aScBpT.jpg",
    name: "较场尾·罗马假日海边度假民宿9房",
    showMinPrice: "2280",
    showMinAverage: "76",
  },
  {
    id: "896bf160-ae67-11ec-ba5b-3bb17d65f78f",
    updateTime: "2022-03-27",
    imageUrl:
      "https://img.villaday.com/images/merchant/10645/audit_house/CbSzQkKA2E.jpg",
    name: "深圳较场尾大鹏古城8房一厅独栋客栈",
    showMinPrice: "2688",
    showMinAverage: "141",
  },
  {
    id: "8fa56b10-ae67-11ec-ba5b-3bb17d65f78f",
    updateTime: "2022-03-27",
    imageUrl:
      "https://img.villaday.com/images/house_834/349369154/349369154-10-14844437.jpg",
    name: "较场尾·阿罗哈客栈26房包场",
    showMinPrice: "9798",
    showMinAverage: "144",
  },
  {
    id: "9513cc90-ae67-11ec-ba5b-3bb17d65f78f",
    updateTime: "2022-03-26",
    imageUrl:
      "https://img.villaday.com/images/house_127/267520127/267520127-10-15061214.jpg",
    name: "较场尾·阳光海岸精品客栈6房",
    showMinPrice: "2280",
    showMinAverage: "152",
  },
];

// 1. 找出有哪些日期
let dateList = list.map((item) => item.updateTime);
// 2. 对日期列表去重
let set = new Set(dateList);
// 3. 把set转成数组
dateList = [...set];

// 用来存放处理后的数据
var newList = [];
// 对dateList进行遍历,过滤出相同日期的数据
dateList.forEach((date) => {
  // 从list列表找到日期跟date相同的对象
  let subList = list.filter((item) => item.updateTime === date);
  // 构造对象
  let obj = {
    date,
    subList,
  };
  newList.push(obj);
});

console.log(newList);
